home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / quicktime / wired movies and sprites / qtwiredsprites / qtwiredsprites.h < prev    next >
Encoding:
Text File  |  2000-09-28  |  3.4 KB  |  116 lines

  1. //////////
  2. //
  3. //    File:        QTWiredSprites.c
  4. //
  5. //    Contains:    QuickTime wired sprites support for QuickTime movies.
  6. //                This file is used for BOTH MacOS and Windows.
  7. //
  8. //    Written by:    Sean Allen
  9. //    Revised by:    Chris Flick and Tim Monroe
  10. //                Based (heavily!) on the existing MakeActionSpriteMovie.c code written by Sean Allen.
  11. //
  12. //    Copyright:    © 1997-1998 by Apple Computer, Inc., all rights reserved.
  13. //
  14. //    Change History (most recent first):
  15. //
  16. //       <1>         03/25/97    rtm        first file; integrated existing code with shell framework
  17. //       
  18. //////////
  19.  
  20. #include <Endian.h>
  21. #include <FixMath.h>
  22. #include <Fonts.h>
  23. #include <Movies.h>
  24. #include <Processes.h>
  25. #include <QuickTimeComponents.h>
  26. #include <Resources.h>
  27. #include <Script.h>
  28.  
  29. #ifndef _WIREDSPRITEUTILITIES_
  30. #include "WiredSpriteUtilities.h"
  31. #endif
  32.  
  33. #ifndef _SPRITEUTILITIES_
  34. #include "SpriteUtilities.h"
  35. #endif
  36.  
  37. #ifndef __ENDIANUTILITIES__
  38. #include "EndianUtilities.h"
  39. #endif
  40.  
  41. #include "ComApplication.h"
  42.  
  43. #if TARGET_OS_MAC
  44. #include "MacFramework.h"
  45. #endif
  46.  
  47. #if TARGET_OS_WIN32
  48. #include "WinFramework.h"
  49. #endif
  50.  
  51. #define kSpriteTrackWidth                    320
  52. #define kSpriteTrackHeight                    240
  53.  
  54. #define kPenguinWidth                        92
  55. #define kPenguinHeight                        102
  56. #define kStartEndButtonWidth                36
  57. #define kStartEndButtonHeight                19
  58. #define kNextPrevButtonWidth                28
  59. #define kNextPrevButtonHeight                19
  60.  
  61. #define kGoToBeginningButtonUp                10000
  62. #define kGoToBeginningButtonDown            10001
  63. #define kGoToEndButtonUp                    10002
  64. #define kGoToEndButtonDown                    10003
  65. #define kGoToPrevButtonUp                    10004
  66. #define kGoToPrevButtonDown                    10005
  67. #define kGoToNextButtonUp                    10006
  68. #define kGoToNextButtonDown                    10007
  69. #define kPenguinForward                        20000
  70. #define kPenguinLeft                        20001
  71. #define kPenguinRight                        20002
  72. #define kPenguinClosed                        20003
  73. #define kWalkDownRightCycleStart            20004
  74. #define kWalkDownRightCycleEnd                20015
  75. #define kPenguinWalkCycleLength                (kWalkDownRightCycleEnd - kWalkDownRightCycleStart + 1)
  76. #define kPenguinFlapCycleStart                30000
  77. #define kPenguinFlapCycleEnd                30005
  78. #define kPenguinFlapCycleLength                (kPenguinFlapCycleEnd - kPenguinFlapCycleStart + 1)
  79.  
  80. #define kGoToBeginningButtonUpIndex            1
  81. #define kGoToBeginningButtonDownIndex        2
  82. #define kGoToEndButtonUpIndex                3
  83. #define kGoToEndButtonDownIndex                4
  84. #define kGoToPrevButtonUpIndex                5
  85. #define kGoToPrevButtonDownIndex            6
  86. #define kGoToNextButtonUpIndex                7
  87. #define kGoToNextButtonDownIndex            8
  88. #define kPenguinForwardIndex                9
  89. #define kPenguinLeftIndex                    10
  90. #define kPenguinRightIndex                    11
  91. #define kPenguinClosedIndex                    12
  92. #define kPenguinDownRightCycleStartIndex    13
  93. #define kPenguinDownRightCycleEndIndex        (kPenguinDownRightCycleStartIndex + kPenguinWalkCycleLength - 1)
  94.  
  95. #define kSpriteMediaTimeScale                600
  96. #define kSpriteMediaFrameDuration            20
  97. #define kSpriteMediaFramesPerSecond            (kSpriteMediaTimeScale / kSpriteMediaFrameDuration)
  98.  
  99. #define kGoToBeginningSpriteID                1
  100. #define kGoToPrevSpriteID                    2
  101. #define kGoToNextSpriteID                    3
  102. #define kGoToEndSpriteID                    4
  103. #define kPenguinOneSpriteID                    5
  104. #define kPenguinTwoSpriteID                    6
  105.  
  106. #define kNumOverrideSamples                    (2 * kPenguinWalkCycleLength)
  107.  
  108. #define kPenguinStateVariableID                1
  109. #define kButtonStateOne                        0
  110. #define kButtonStateTwo                        1
  111.  
  112. // function prototypes
  113. OSErr                            QTWired_CreateWiredSpritesMovie (void);
  114. OSErr                            QTWired_AddPenguinTwoConditionalActions (QTAtomContainer theContainer, QTAtom theEventAtom);
  115. OSErr                            QTWired_AddWraparoundMatrixOnIdle (QTAtomContainer theContainer);
  116.